package redis;

import report.entity.MySampleResult;
import utils.SerializUtil;

import java.io.IOException;

public class QueueUtils {

	// 入队
	public static void lpush(String redisKey, MySampleResult mySample) {

		try {
			JedisUtil.lpush(redisKey.getBytes(), SerializUtil.object2Bytes(mySample));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	// 出队
	public static MySampleResult lpop(String redisKey) {

		try {
			byte[] bytes = JedisUtil.rpop(redisKey.getBytes());
			MySampleResult mySample = (MySampleResult) SerializUtil.bytes2Object(bytes);
			return mySample;
		} catch (Exception e) {
			e.printStackTrace();
		}

		return null;
	}

	// 更新数据
}
